//
//  HRStatusRetweetedView.swift
//  microBlog
//
//  Created by HR_W on 16/5/25.
//  Copyright © 2016年 admin. All rights reserved.
//

import UIKit
import SnapKit

class HRStatusRetweetedView: UIView {

    var statusViewModel: HRStatusViewModel?{
    
        didSet {
        
        contentLabel.text = statusViewModel?.status?.retweeted_status?.text
            
            pictureView.pictures = statusViewModel?.status?.retweeted_status?.pic_urls
        
        }
    
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupUI() {
        backgroundColor = UIColor(white: 0.95, alpha: 1)
        addSubview(contentLabel)
        addSubview(pictureView)
        
        contentLabel.snp_makeConstraints { (make) in
            make.top.left.equalTo(self).offset(margin)
        }
    
        pictureView.snp_makeConstraints { (make) in
            make.top.equalTo(contentLabel.snp_bottom).offset(margin)
            make.left.equalTo(contentLabel.snp_left)
           
        }
        
        self.snp_makeConstraints { (make) in
            make.bottom.equalTo(pictureView.snp_bottom).offset(margin)
        }
    }
    
    private lazy var contentLabel: UILabel = UILabel(titie: "你好的啊", font: 14, textColor: UIColor.darkGrayColor(), alignment: .Left)
    
    private lazy var pictureView: HRStatusPictureView = HRStatusPictureView()
  
}
